package controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import model.Role;
import service.RoleService;

@Controller
public class RoleController {

	@Autowired
	private RoleService roleService;
	
	@RequestMapping("/roles")
	public ModelAndView list() {
		ModelAndView view = new ModelAndView("rolesList");
		List<Role> roles = roleService.findPage();
		view.addObject("roles", roles);
		return view;
	}
	
}
